<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  
</body>
<script>
  /*
  * 编写函数rightchange(char,n) 实现字符串char循环右移n位。
  * 比如rightchange("abcdefg",2) 返回"fgabcde"
  */

  //定义函数
  function rightchange(char,n){
    return char.substring(char.length-n).concat(char.substring(0,char.length-n));
  };

  //执行
  console.log(rightchange('1234557',2));  

</script>
</html>